﻿// ***********************************************************************
// Assembly         : ElFinder.Net
// Author           : Lolo
// Created          : 06-05-2013
//
// Last Modified By : Lolo
// Last Modified On : 06-05-2013
// ***********************************************************************
// <copyright file="AddResponse.cs" company="">
//     Copyright (c) . All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using ElFinder.DTO;

namespace ElFinder.Response
{
    /// <summary>
    /// Class AddResponse
    /// </summary>
    [DataContract]
    internal class AddResponse
    {
        /// <summary>
        /// The _added
        /// </summary>
        private List<DTOBase> _added;

        /// <summary>
        /// Gets the added.
        /// </summary>
        /// <value>The added.</value>
        [DataMember(Name = "added")]
        public List<DTOBase> Added { get { return _added; } }

        /// <summary>
        /// Initializes a new instance of the <see cref="AddResponse" /> class.
        /// </summary>
        /// <param name="newFile">The new file.</param>
        /// <param name="root">The root.</param>
        public AddResponse(FileInfo newFile, Root root)
        {
            _added = new List<DTOBase>() { DTOBase.Create(newFile, root) };
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AddResponse" /> class.
        /// </summary>
        /// <param name="newDir">The new dir.</param>
        /// <param name="root">The root.</param>
        public AddResponse(DirectoryInfo newDir, Root root)
        {
            _added = new List<DTOBase>() { DTOBase.Create(newDir, root) };
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AddResponse" /> class.
        /// </summary>
        public AddResponse()
        {
            _added = new List<DTOBase>();
        }
    }
}